package com.abhinav.designPatterns.visitor;

// Concrete Visitor
public class GeneralReport implements IVisitor {

	private int customersNo;
	private int ordersNo;
	private int itemsNo;

	@Override
	public void visit(Customer customer) {
		System.out.println("Customer Name: " + customer.getName());
		customersNo++;
	}

	@Override
	public void visit(Order order) {
		System.out.println("Order Name: " + order.getName());
		ordersNo++;
	}

	@Override
	public void visit(Item item) {
		System.out.println("Item Name: " + item.getName());
		itemsNo++;
	}

	public void displayResults() {
		System.out.println("No of customers:" + customersNo);
		System.out.println("No of orders:   " + ordersNo);
		System.out.println("No of items:   " + itemsNo);
	}

}
